package com.hhh.springai_test.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hhh.springai_test.model.po.BookBorrow;
import com.hhh.springai_test.model.vo.BookBorrowVO;
import com.hhh.springai_test.model.dto.bookborrow.BookBorrowAddRequest;
import com.hhh.springai_test.model.dto.bookborrow.BookBorrowQueryRequest;
import com.hhh.springai_test.model.dto.bookborrow.BookBorrowUpdateRequest;

import java.util.List;

/**
* @author 29915
* @description 针对表【book_borrow(图书借阅表)】的数据库操作Service
* @createDate 2025-02-05 12:26:11
*/
public interface BookBorrowService extends IService<BookBorrow> {
    
    /**
     * 批量添加借阅记录
     * @param bookBorrowAddRequests 借阅请求列表
     * @return 是否添加成功
     */
    boolean addBookBorrows(List<BookBorrowAddRequest> bookBorrowAddRequests, Long userId);

    /**
     * 更新借阅状态
     * @param updateRequest 更新请求
     * @return 是否更新成功
     */
    boolean updateBookBorrow(BookBorrowUpdateRequest updateRequest, Long userId);

    /**
     * 分页获取借阅列表
     * @param queryRequest 查询条件
     * @return 分页结果
     */
    Page<BookBorrowVO> listBookBorrowByPage(BookBorrowQueryRequest queryRequest);

    Page<BookBorrowVO> listUserBookBorrows(BookBorrowQueryRequest queryRequest, Long userId);
}
